public class RemoteControlTest {

    public static void main(String[] args) {
        SimpleRemoteControl remote = new SimpleRemoteControl();
        Light light = new Light("livining room");
        Command lightOn = new LightOnCommand(light);
        remote.SetCommand(lightOn);

        remote.buttownWasPressed();
    }
}

/*
Control -> Command -> Receiver

为什么不直接把light.on传入遥控器呢，大概是因为面向对象所以需要多封装一层command，除此之外我们命令还封装了一个undo功能

遥控器有slot关联command(has)，又有动态更新command的方法setCommand
command关联receiver的action(has)

 */